package com.ys.zero.web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ys.zero.bean.Uarticle;
import com.ys.zero.bean.User;
import com.ys.zero.dao.UserbackDao;

/**
 * 
 *	用户后台管理
 *
 */
@WebServlet("/userBack/*")
public class userBackServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;
	
	UserbackDao dao = new UserbackDao();
       
	protected void show(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		User user = (User) request.getSession().getAttribute("loginedUser");
		
		List<Uarticle> list = dao.getArticle(user.getId());
		
		toJson(response,list);
	}
	
	protected void delArticle(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String uaid = request.getParameter("uaid");
		dao.delArticle(uaid);
	}

}
